import request from '@/utils/request'

export function user_menu_list() {
  return request({
    url: '/user/role_perms/',
    method: 'get',
  })
}

export function perms_list(query){
  return request({
    url: '/user/perm/',
    method: 'get',
    params: query
  })
}

export function addPerm(permInfo){
  return request({
    url: '/user/perm/',
    method: 'post',
    data: permInfo
  })
}

export function updatePerm(permInfo){
  return request({
    url: `/user/perm/${permInfo.id}/`,
    method: 'patch',
    data: permInfo
  })
}

export function delPerm(perm_id){
  return request({
    url: `/user/perm/${perm_id}/`,
    method: 'delete',
  })
}